"use strict";

const Controller = require("egg").Controller;

class RoleController extends Controller {
    async index() {
        const { ctx } = this;
        // 获取角色列表
        const roles = await this.service.role.readList();
        ctx.body = {
            code: 200,
            data: roles,
            message: "请求成功",
        };
    }

    async create() {
        const { name } = this.ctx.request.body;
        //
        // 获取角色列表
        const roles = await this.service.role.readList();
        ctx.body = {
            code: 200,
            data: roles,
            message: "请求成功",
        };
    }
}

module.exports = RoleController;
